<%@page import="com.sun.corba.se.spi.orbutil.fsm.Guard.Result"%>
<%@page import="com.gavinnie.util.EncryptionCoder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
 <%
 	String username = "";
 	String password = "";
 	String checkbox = "";
 	
 	Cookie[] cookies = request.getCookies();
 	for(Cookie cookie:cookies){
 		if("username".equals(cookie.getName())){
 			//解密 //可以自己设定解密规则,见EncryptionCode中的encryptionRules
 			username = new String(EncryptionCoder.decryptBASE64(cookie.getValue()));
 			//设置复选框是否勾上
 			checkbox = "checked='checked'";
 		}
 		if("password".equals(cookie.getName())){
 			//解密
 			password = new String(EncryptionCoder.decryptBASE64(cookie.getValue()));
 		}
 	}
 	
 %>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>保存用户名,密码</title>
</head>
<body>
	<form action="saveAction" method="post">
		<label>用户名:</label>
		<input type="text" name="username" value="<%=username%>"/>
		<label>密码:</label>
		<input type="password" name="password" value="<%=password%>"/>
		<br/>
		<input type="checkbox" name="checkbox" id="checkbox" <%=checkbox%> /><label for="checkbox">保存用户名密码</label> 
		<br/>
		<input type="submit" value="提交"/>
	</form>
</body>
</html>